<?xml version="1.0" encoding="utf-8"?>
<process version="1" name="Messages" xmlns="http://www.nginn.org/WorkflowDefinition.1_0.xsd" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <dataTypes>
    </dataTypes>
    <variables>
    </variables>
    <body>
        <places>
            <place id="start" type="Start" />
            <place id="end" type="End" />
        </places>
        <tasks>
            <task id="T0" type="Empty" splitType="AND">
            </task>
			
			<task id="T1" type="ReceiveMessage">
				<parameters>
					<param variable="MessageCorrelationId"><expr>taskInstance.ProcessInstanceId + '.T1'</expr></param>
				</parameters>
            </task>
			
			<task id="T1" type="SQL">
				<variables>
					<variable name="Login" dir="In" type="string" required="true" />
					<variable name="Id" dir="Out" type="string" required="true" />
				</variables>
				<parameters>
					<param variable="Query"><expr>"select id as Id from Contact where login=@p1"</expr></param>
					<param variable="@p1"><expr>data.Login</expr></param>
				</parameters>
				<inputBindings>
					<bind variable="v1"><sourceVar>v1</sourceVar></bind>
				</inputBindings>
				<outputBindings>
					<bind variable="v1"><sourceVar>v1</sourceVar></bind>
				</outputBindings>
            </task>
			
			<task id="T2" type="Timer">
				<variables>
				</variables>
				<outputBindings>
				</outputBindings>
				<parameters>
					<param variable="DelayAmount"><expr>TimeSpan.FromMinutes(1)</expr></param>
				</parameters>
            </task>
			
			<task id="T3" type="SendMessage">
				<parameters>
					<param variable="MessageCorrelationId"><expr>taskInstance.ProcessInstanceId + '.T1'</expr></param>
				</parameters>
            </task>
            
        </tasks>
        <flows>
            <flow from="start" to="T0" />
            <flow from="T0" to="T1" />
			<flow from="T0" to="T2" />
			<flow from="T2" to="T3" />
            <flow from="T3" to="end" />
            <flow from="T1" to="end" />
        </flows>
    </body>
</process>